package com.keyue.isolate.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;


@Getter
@AllArgsConstructor
public enum DataPermissionModelRangeEnum {

    ORDER_QY("100", DataPermissionFieldEnum.getOrderQY(), "企业订单"),
    ORDER_LS("101", DataPermissionFieldEnum.getOrderLS(), "零售订单"),
    ORDER_XX_PLAN("102", DataPermissionFieldEnum.getOrderXXPlan(), "线下计划"),
    ORDER_XX("103", DataPermissionFieldEnum.getOrderXX(), "线下订单"),
    ORDER_WAIT_MATCH("104", DataPermissionFieldEnum.getOrderWaitMatch(), "待匹配订单"),
    ORDER_OUT("105", DataPermissionFieldEnum.getOrderOut(), "外部订单"),


    TRANSPORT_PLAT("200", DataPermissionFieldEnum.getTransportPlat(), "运输平台"),


    FINANCE_SH("300", DataPermissionFieldEnum.getFinanceSH(), "收货凭证"),
    FINANCE_CPK_PRICE("301", DataPermissionFieldEnum.getFinanceCPKPrice(), "承运商运价表"),
    //    FINANCE_MRD_PRICE("302", DataPermissionFieldEnum.getFinanceMRDPrice(), "明睿达承运商运价表"),
    FINANCE_CPK_BILL("303", DataPermissionFieldEnum.getFinanceCPKBill(), "成品库对账单"),
    FINANCE_MRD_BILL("304", DataPermissionFieldEnum.getFinanceMRDBill(), "明睿达对账单"),
    FINANCE_IN_OUT("305", DataPermissionFieldEnum.getFinanceInOut(), "出入库数据"),
    FINANCE_ZX_PRICE("306", DataPermissionFieldEnum.getFinanceZXPrice(), "装卸货价格"),
    FINANCE_ZX_PZ("307", DataPermissionFieldEnum.getFinanceZXPZ(), "装卸货凭证"),
    FINANCE_ZX_BILL("308", DataPermissionFieldEnum.getFinanceZXBill(), "装卸费账单"),
    FINANCE_ZX_BT("309", DataPermissionFieldEnum.getFinanceZXBT(), "装卸货补贴"),


    BUSINESS("400", DataPermissionFieldEnum.getBusiness(), "业务伙伴"),

    CUSTOMER("500", DataPermissionFieldEnum.getCustomer(), "客户管理"),

    ALL_VIEW("600", DataPermissionFieldEnum.getAllView(), "全链路看板"),
    ALL_GX_VIEW("601", DataPermissionFieldEnum.getAllGxView(), "干线网批看板"),
    ;

    private String modelType;

    private List<String> fieldRanges;

    private String desc;

    /**
     * @param modelType
     * @return
     */
    public static List<String> getFieldRangeList(String modelType) {
        for (DataPermissionModelRangeEnum modelRangeEnum : DataPermissionModelRangeEnum.values()) {
            if (modelRangeEnum.getModelType().equals(modelType)) {
                return modelRangeEnum.getFieldRanges();
            }
        }
        return null;
    }

}
